package com.baizhi.hospital.controller;

import com.baizhi.hospital.entity.Department;
import com.baizhi.hospital.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    @RequestMapping("/selectDepartmentByPage")
    @ResponseBody
    public Map selectDepartmentByPage(int page,int limit,String patientName){
        return departmentService.selectDepartmentByPage(page, limit, patientName);
    }
    @RequestMapping("/insert")
    @ResponseBody
    public Map insert(Department department){
        return departmentService.insert(department);
    }
    @RequestMapping("/remove")
    @ResponseBody
    public Map remove(int departmentId){
        return departmentService.delete(departmentId);
    }
    @RequestMapping("/selectOne")
    @ResponseBody
    public Department selectOne(int departmentId){
        return departmentService.selectOne(departmentId);
    }
    @RequestMapping("/update")
    @ResponseBody
    public Map update(Department department){
        return departmentService.update(department);
    }
    @RequestMapping("/multiDelete")
    @ResponseBody
    public Map multiDelete(int [] ids){
        return departmentService.multiDelete(ids);
    }
}
